
GamesView

	proc
		Display(mob/chatter/C, page)
			switch(page)
				if("roll_play")
					winset(C, "games.roll_play_button", "is-checked=true;")
					winset(C, "games.trivia_button", "is-checked=false;")
					winset(C, "games.hangman_button", "is-checked=false;")
					winset(C, "games.oracle_button", "is-checked=false;")
					winset(C, "games.quest_button", "is-checked=false;")
					winset(C, "games.child", "left=roll_play;")
					winset(C, "roll_play.output", "style='[TextMan.escapeQuotes(C.default_output_style)]';max-lines='[C.max_output]';")
					C.game_color = "#C00"
					for(var/p in typesof(/Games/RollPlay/proc)-/Games/RollPlay/proc)
						if(!(p:name in C.verbs)) C.verbs += p
					if(winget(C, "games", "is-visible")=="false") call(C,"RollLook")()
				if("trivia")
					winset(C, "games.roll_play_button", "is-checked=false;")
					winset(C, "games.trivia_button", "is-checked=true;")
					winset(C, "games.hangman_button", "is-checked=false;")
					winset(C, "games.oracle_button", "is-checked=false;")
					winset(C, "games.quest_button", "is-checked=false;")
					winset(C, "games.child", "left=trivia;")
					winset(C, "trivia.output", "style='[TextMan.escapeQuotes(C.default_output_style)]';max-lines='[C.max_output]';")
					C.game_color = "#C0C"
				if("hangman")
					winset(C, "games.roll_play_button", "is-checked=false;")
					winset(C, "games.trivia_button", "is-checked=false;")
					winset(C, "games.hangman_button", "is-checked=true;")
					winset(C, "games.oracle_button", "is-checked=false;")
					winset(C, "games.quest_button", "is-checked=false;")
					winset(C, "games.child", "left=hangman;")
					C << browse_rsc('./resources/images/hangman/head.png', "head.png")
					C << browse_rsc('./resources/images/hangman/upper_arm_left.png', "upper_arm_left.png")
					C << browse_rsc('./resources/images/hangman/upper_arm_right.png', "upper_arm_right.png")
					C << browse_rsc('./resources/images/hangman/lower_arm_left.png', "lower_arm_left.png")
					C << browse_rsc('./resources/images/hangman/lower_arm_right.png', "lower_arm_right.png")
					C << browse_rsc('./resources/images/hangman/upper_leg_left.png', "upper_leg_left.png")
					C << browse_rsc('./resources/images/hangman/upper_leg_right.png', "upper_leg_right.png")
					C << browse_rsc('./resources/images/hangman/lower_leg_left.png', "lower_leg_left.png")
					C << browse_rsc('./resources/images/hangman/lower_leg_right.png', "lower_leg_right.png")
					C << browse_rsc('./resources/images/hangman/top_brace.png', "top_brace.png")
					C << browse_rsc('./resources/images/hangman/bottom_brace.png', "bottom_brace.png")
					C << output(file('./resources/hangman.html'), "hangman.browser")
					C.game_color = "#00C"
				if("oracle")
					winset(C, "games.roll_play_button", "is-checked=false;")
					winset(C, "games.trivia_button", "is-checked=false;")
					winset(C, "games.hangman_button", "is-checked=false;")
					winset(C, "games.oracle_button", "is-checked=true;")
					winset(C, "games.quest_button", "is-checked=false;")
					winset(C, "games.child", "left=oracle;")
					winset(C, "oracle.output", "style='[TextMan.escapeQuotes(C.default_output_style)]';max-lines='[C.max_output]';")
					C.game_color = "#0C0"
				if("quest")
					winset(C, "games.roll_play_button", "is-checked=false;")
					winset(C, "games.trivia_button", "is-checked=false;")
					winset(C, "games.hangman_button", "is-checked=false;")
					winset(C, "games.oracle_button", "is-checked=false;")
					winset(C, "games.quest_button", "is-checked=true;")
					winset(C, "games.child", "left=quest;")
					winset(C, "quest.input", "text='? ';")
					winset(C, "quest.output", "style='[TextMan.escapeQuotes(C.default_output_style)]';max-lines='[C.max_output]';")
					C.game_color = "#000"
			winshow(C, "games", 1)
			if(C.afk) C.ReturnAFK()
			if(!C.Chan.players) C.Chan.players = new()
			if(!(C in C.Chan.players))
				C.Chan.players += C
				C.Chan.players = C.Chan.SortWho(C.Chan.players)
			GameMan.UpdateWho(C.Chan)


		Initialize(mob/chatter/C)
			if(!C || !C.client) return
			winset(C, "games.roll_play_button", "command='BrowseRollPlay';")
			winset(C, "games.trivia_button", "command='BrowseTrivia';")
			winset(C, "games.hangman_button", "command='BrowseHangman';")
			winset(C, "games.oracle_button", "command='BrowseOracle';")
			winset(C, "games.quest_button", "command='BrowseQuest';")